package com.bgIntlgn.client.entity.jishubu;

import yuhuibear.poat.annotations.action.AutoGenerateValue;
import yuhuibear.poat.annotations.relation.Field;
import yuhuibear.poat.annotations.relation.Table;
import yuhuibear.poat.object.bean.Bean;

/**
 * 表示零件的别名
 * 
 * @author yuhui
 * 
 */
@Table(name = "alias", constrain = "unique(name, element_id)")
public class Alias implements Bean {

	@AutoGenerateValue(skipOnNull = true, sqlToGet = "select currval('alias_id_seq')")
	@Field(name = "id", type = "bigserial", constrain = "primary key ")
	private Long id;

	/**
	 * 参考零件的elementId
	 */
	@Field(name = "element_id", type = "int8", constrain = " not null references elements(id) on update cascade ")
	private Long elementId;

	@Field(name = "custom_id", type = "int8", constrain = "references customs(id)  on update cascade ")
	private Long customId;

	/**
	 * 零件别名
	 */
	@Field(name = "name", type = "varchar(60)", constrain = "unique")
	private String name;

	public Long getElementId() {
		return this.elementId;
	}

	public void setElementId(Long elementId) {
		this.elementId = elementId;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getCustomId() {
		return this.customId;
	}

	public void setCustomId(Long customId) {
		this.customId = customId;
	}

}
